<!DOCTYPE html>
<html>
<meta charset="utf-8">
<head>
	<title>Vue CSS动画效果</title>
	<script type="text/javascript" src="./vue.js"></script>
</head>
<style type="text/css">
	.v-enter {
		opacity: 0;
	}
	.v-enter-active {
		transition: opacity 3s;
	}
	.v-leave-to {
		opacity: 0;
	}
	.v-leave-active {
		transition: opacity 3s;
	}
</style>
<body>	
	<div id="app">
		<!-- 在需要添加动画的dom元素添加transition标签，通过控制v-enter/v-enter-active/v-leave-on/v-leave-active样式进行动画效果的战士 -->
		<transition>
			<div v-if="show">hello world</div>
		</transition>
		<button @click="toggleShow">切换</button>
	</div>
	<script>
		var app = new Vue({
			el : '#app',
			data : {
				show : true
			},
			methods :{
				toggleShow : function() {
					this.show = !this.show;
				}
			} 
		});
	</script>
</body>
</html>